//
//  Team9BaseLabel.m
//  Team9Project
//
//  Created by 朱嘉祺 on 15/10/12.
//  Copyright © 2015年 apple. All rights reserved.
//

#import "Team9BaseLabel.h"

@interface Team9BaseLabel ()

@property(nonatomic, assign)LableColorType type;

@end
@implementation Team9BaseLabel


#pragma mark 夜间模式
- (instancetype)init{
    return [self initWith:LableColorTypeBlackWhite];
}

- (instancetype)initWith:(LableColorType)type{
    self = [super init];
    if (self) {
        self.type = type;
        [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(changecolor) name:@"changecolor" object:nil];
        [self changecolor];
    }
    return self;
}

- (void)changecolor{
    if (![Team9EveningType shareEvening].eveningFailling) {
        switch (self.type) {
            case LableColorTypeBlackWhite:
                self.textColor = [UIColor blackColor];
                break;
            case LableColorTypeOrangeGreen:
                self.textColor = [UIColor orangeColor];
                break;
            case LableColorTypeRedCyan:
                self.textColor = [UIColor redColor];
                break;
            default:
                break;
        }
    } else {
        switch (self.type) {
            case LableColorTypeBlackWhite:
                self.textColor = [UIColor whiteColor];
                break;
            case LableColorTypeOrangeGreen:
                self.textColor = [UIColor greenColor];
                break;
            case LableColorTypeRedCyan:
                self.textColor = [UIColor cyanColor];
                break;
            default:
                break;
        }
    }
}
@end
